package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.HomeBannerBean;
import com.common.retrofit.entity.bean.UserBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class BannerMethods extends BaseMethods {

    private static BannerMethods m_ins = null;

    public static BannerMethods getInstance() {
        if (m_ins == null) {
            synchronized (BannerMethods.class) {
                if (m_ins == null) {
                    m_ins = new BannerMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Index/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void banner_list(Subscriber<HomeBannerBean> subscriber,
                  int type  ) {
        Observable observable = initService().banner_list(System.currentTimeMillis()+"",
                "9f7a999afac43e6b50ef7204f69f93b7",type
        );
        toSubscribe(observable, subscriber);
    }
}
